.class final Lcom/mobisage/android/i;
.super Lcom/mobisage/android/O;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/mobisage/android/i$a;
    }
.end annotation


# instance fields
.field private g:Lcom/mobisage/android/i$a;


# direct methods
.method public constructor <init>(Landroid/os/Handler;)V
    .locals 2
    .parameter

    .prologue
    .line 23
    invoke-direct {p0, p1}, Lcom/mobisage/android/O;-><init>(Landroid/os/Handler;)V

    .line 24
    const/16 v0, 0x3ed

    iput v0, p0, Lcom/mobisage/android/i;->c:I

    .line 25
    new-instance v0, Lcom/mobisage/android/i$a;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/mobisage/android/i$a;-><init>(Lcom/mobisage/android/i;B)V

    iput-object v0, p0, Lcom/mobisage/android/i;->g:Lcom/mobisage/android/i$a;

    .line 28
    new-instance v0, Lcom/mobisage/android/h;

    invoke-direct {v0}, Lcom/mobisage/android/h;-><init>()V

    .line 29
    iget-object v1, p0, Lcom/mobisage/android/i;->d:Ljava/util/LinkedList;

    invoke-virtual {v1, v0}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 31
    return-void
.end method

.method private a(Ljava/lang/String;Lcom/mobisage/android/b;Ljava/util/ArrayList;)Ljava/lang/String;
    .locals 10
    .parameter
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Lcom/mobisage/android/b;",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;)",
            "Ljava/lang/String;"
        }
    .end annotation

    .prologue
    const/4 v9, 0x0

    .line 115
    new-instance v1, Ljava/util/LinkedList;

    invoke-direct {v1}, Ljava/util/LinkedList;-><init>()V

    .line 118
    invoke-static {p1, v1}, Lcom/mobisage/android/SNSSSLSocketFactory$a;->a(Ljava/lang/String;Ljava/util/LinkedList;)Z

    move-result v0

    .line 119
    if-nez v0, :cond_0

    move-object v0, v9

    .line 156
    :goto_0
    return-object v0

    .line 123
    :cond_0
    invoke-static {p1, v1}, Lcom/mobisage/android/SNSSSLSocketFactory$a;->b(Ljava/lang/String;Ljava/util/LinkedList;)Z

    move-result v0

    .line 124
    if-nez v0, :cond_1

    move-object v0, v9

    .line 125
    goto :goto_0

    .line 128
    :cond_1
    const/4 v0, 0x0

    move v2, v0

    move-object v3, p1

    :goto_1
    invoke-virtual {v1}, Ljava/util/LinkedList;->size()I

    move-result v0

    if-ge v2, v0, :cond_5

    .line 130
    invoke-virtual {v1, v2}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    .line 131
    invoke-virtual {v3, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v4

    .line 132
    const/4 v5, -0x1

    if-eq v4, v5, :cond_6

    .line 133
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    .line 136
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    .line 138
    invoke-static {v9, v0, v4, v5}, Lcom/mobisage/android/SNSSSLSocketFactory$a;->a(Ljava/security/MessageDigest;Ljava/lang/String;Ljava/lang/StringBuilder;Ljava/lang/StringBuilder;)Z

    move-result v6

    .line 139
    if-nez v6, :cond_2

    move-object v0, v9

    .line 140
    goto :goto_0

    .line 142
    :cond_2
    const-string v6, "."

    invoke-virtual {v0, v6}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v6

    add-int/lit8 v6, v6, 0x1

    invoke-virtual {v0, v6}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v6

    .line 143
    const-string v7, "htm"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v7

    if-nez v7, :cond_3

    const-string v7, "html"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_4

    .line 144
    :cond_3
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "file://"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p3, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 146
    :cond_4
    new-instance v6, Lcom/mobisage/android/b;

    invoke-direct {v6}, Lcom/mobisage/android/b;-><init>()V

    .line 147
    iget-object v7, v6, Lcom/mobisage/android/b;->c:Landroid/os/Bundle;

    const-string v8, "SourceURL"

    invoke-virtual {v7, v8, v0}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 148
    iget-object v7, v6, Lcom/mobisage/android/b;->c:Landroid/os/Bundle;

    const-string v8, "TempURL"

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v7, v8, v5}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 149
    iget-object v5, v6, Lcom/mobisage/android/b;->c:Landroid/os/Bundle;

    const-string v7, "TargetURL"

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v5, v7, v8}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 150
    iget-object v5, p0, Lcom/mobisage/android/i;->b:Lcom/mobisage/android/O$a;

    iput-object v5, v6, Lcom/mobisage/android/b;->g:Lcom/mobisage/android/a;

    .line 151
    iget-object v5, p2, Lcom/mobisage/android/b;->b:Ljava/util/UUID;

    iput-object v5, v6, Lcom/mobisage/android/b;->a:Ljava/util/UUID;

    .line 153
    iget-object v5, p2, Lcom/mobisage/android/b;->e:Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-virtual {v5, v6}, Ljava/util/concurrent/LinkedBlockingQueue;->add(Ljava/lang/Object;)Z

    .line 154
    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "file://"

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v0, v4}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v0

    .line 129
    :goto_2
    add-int/lit8 v2, v2, 0x1

    move-object v3, v0

    goto/16 :goto_1

    :cond_5
    move-object v0, v3

    .line 156
    goto/16 :goto_0

    :cond_6
    move-object v0, v3

    goto :goto_2
.end method


# virtual methods
.method public final a(Landroid/os/Message;)V
    .locals 7
    .parameter

    .prologue
    .line 37
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    instance-of v0, v0, Lcom/mobisage/android/b;

    if-eqz v0, :cond_2

    .line 38
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/mobisage/android/b;

    invoke-virtual {p0, v0}, Lcom/mobisage/android/i;->b(Lcom/mobisage/android/b;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 39
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/mobisage/android/b;

    invoke-virtual {p0, v0}, Lcom/mobisage/android/i;->c(Lcom/mobisage/android/b;)V

    .line 46
    :cond_0
    :goto_0
    return-void

    .line 42
    :cond_1
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/mobisage/android/b;

    iget-object v1, p0, Lcom/mobisage/android/i;->e:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v2, v0, Lcom/mobisage/android/b;->b:Ljava/util/UUID;

    invoke-virtual {v1, v2, v0}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    new-instance v1, Lcom/mobisage/android/I;

    invoke-direct {v1}, Lcom/mobisage/android/I;-><init>()V

    iget-object v2, p0, Lcom/mobisage/android/i;->g:Lcom/mobisage/android/i$a;

    iput-object v2, v1, Lcom/mobisage/android/I;->callback:Lcom/mobisage/android/IMobiSageMessageCallback;

    iget-object v2, v0, Lcom/mobisage/android/b;->c:Landroid/os/Bundle;

    iput-object v2, v1, Lcom/mobisage/android/I;->params:Landroid/os/Bundle;

    iget-object v2, v0, Lcom/mobisage/android/b;->f:Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-virtual {v2, v1}, Ljava/util/concurrent/LinkedBlockingQueue;->add(Ljava/lang/Object;)Z

    iget-object v2, p0, Lcom/mobisage/android/i;->f:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v3, v1, Lcom/mobisage/android/I;->c:Ljava/util/UUID;

    iget-object v0, v0, Lcom/mobisage/android/b;->b:Ljava/util/UUID;

    invoke-virtual {v2, v3, v0}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-static {}, Lcom/mobisage/android/H;->a()Lcom/mobisage/android/H;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/mobisage/android/H;->a(Lcom/mobisage/android/MobiSageMessage;)V

    goto :goto_0

    .line 44
    :cond_2
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    instance-of v0, v0, Lcom/mobisage/android/I;

    if-eqz v0, :cond_0

    .line 45
    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Lcom/mobisage/android/I;

    iget-object v1, p0, Lcom/mobisage/android/i;->f:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v2, v0, Lcom/mobisage/android/I;->c:Ljava/util/UUID;

    invoke-virtual {v1, v2}, Ljava/util/concurrent/ConcurrentHashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/mobisage/android/i;->f:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v2, v0, Lcom/mobisage/android/I;->c:Ljava/util/UUID;

    invoke-virtual {v1, v2}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/UUID;

    iget-object v2, p0, Lcom/mobisage/android/i;->e:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v2, v1}, Ljava/util/concurrent/ConcurrentHashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/mobisage/android/i;->e:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v2, v1}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/mobisage/android/b;

    iget-object v2, p0, Lcom/mobisage/android/i;->f:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v3, v0, Lcom/mobisage/android/I;->c:Ljava/util/UUID;

    invoke-virtual {v2, v3}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v2, v1, Lcom/mobisage/android/b;->f:Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-virtual {v2, v0}, Ljava/util/concurrent/LinkedBlockingQueue;->remove(Ljava/lang/Object;)Z

    iget-object v2, v0, Lcom/mobisage/android/I;->result:Landroid/os/Bundle;

    const-string v3, "StatusCode"

    invoke-virtual {v2, v3}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v2

    const/16 v3, 0xc8

    if-eq v2, v3, :cond_3

    const/16 v3, 0x12e

    if-eq v2, v3, :cond_3

    invoke-virtual {p0, v1}, Lcom/mobisage/android/i;->c(Lcom/mobisage/android/b;)V

    goto :goto_0

    :cond_3
    iget-object v0, v0, Lcom/mobisage/android/I;->result:Landroid/os/Bundle;

    const-string v2, "ResponseBody"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getByteArray(Ljava/lang/String;)[B

    move-result-object v0

    const-string v2, "UTF-8"

    invoke-static {v0, v2}, Lorg/apache/http/util/EncodingUtils;->getString([BLjava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_4

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v2

    if-nez v2, :cond_5

    :cond_4
    invoke-virtual {p0, v1}, Lcom/mobisage/android/i;->c(Lcom/mobisage/android/b;)V

    goto/16 :goto_0

    :cond_5
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    invoke-direct {p0, v0, v1, v2}, Lcom/mobisage/android/i;->a(Ljava/lang/String;Lcom/mobisage/android/b;Ljava/util/ArrayList;)Ljava/lang/String;

    move-result-object v3

    if-nez v3, :cond_6

    invoke-virtual {p0, v1}, Lcom/mobisage/android/i;->c(Lcom/mobisage/android/b;)V

    goto/16 :goto_0

    :cond_6
    iget-object v0, v1, Lcom/mobisage/android/b;->e:Ljava/util/concurrent/LinkedBlockingQueue;

    invoke-virtual {v0}, Ljava/util/concurrent/LinkedBlockingQueue;->iterator()Ljava/util/Iterator;

    move-result-object v4

    :goto_1
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_7

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/mobisage/android/b;

    iget-object v5, p0, Lcom/mobisage/android/i;->a:Landroid/os/Handler;

    const/16 v6, 0x3f5

    invoke-virtual {v5, v6}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v5

    iput-object v0, v5, Landroid/os/Message;->obj:Ljava/lang/Object;

    invoke-virtual {v5}, Landroid/os/Message;->sendToTarget()V

    goto :goto_1

    :cond_7
    iget-object v0, v1, Lcom/mobisage/android/b;->d:Landroid/os/Bundle;

    const-string v4, "BannerHTML"

    invoke-virtual {v0, v4, v3}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-eqz v0, :cond_8

    iget-object v0, v1, Lcom/mobisage/android/b;->d:Landroid/os/Bundle;

    const-string v3, "LpgCache"

    invoke-virtual {v0, v3, v2}, Landroid/os/Bundle;->putStringArrayList(Ljava/lang/String;Ljava/util/ArrayList;)V

    :cond_8
    invoke-virtual {v1}, Lcom/mobisage/android/b;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/mobisage/android/i;->e:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v2, v1, Lcom/mobisage/android/b;->b:Ljava/util/UUID;

    invoke-virtual {v0, v2}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v0, v1, Lcom/mobisage/android/b;->g:Lcom/mobisage/android/a;

    if-eqz v0, :cond_0

    iget-object v0, v1, Lcom/mobisage/android/b;->g:Lcom/mobisage/android/a;

    invoke-interface {v0, v1}, Lcom/mobisage/android/a;->a(Lcom/mobisage/android/b;)V

    goto/16 :goto_0
.end method
